package c6.e19;

import java.util.Iterator;
import java.util.Set;
import java.util.TreeMap;

public class e19 {
    public static void main(String[] args){
        TreeMap map=new TreeMap();
        map.put(3,"李四");
        map.put(2,"王五");
        map.put(4,"赵六");
        map.put(3,"张三");
        //使用迭代器 取出所有数据
        Set keySet=map.keySet();
        Iterator it=keySet.iterator();
        while (it.hasNext()){
            Object key=it.next();
            System.out.println(key+":"+map.get(key));
        }
    }
}
